import request from '../utils/request';
import { ILoginParams, IDeptSearchParams, IDept, IUser } from '../types/api';

export default {
  //登录
  login(params: ILoginParams) {
    return request.post('/users/login', params);
  },
  //获取部门信息
  getDeptList(params?: IDeptSearchParams) {
    return request.get<IDept[]>('/dept/list', params);
  },
  //添加部门
  createDept(params?: IDept) {
    console.log(params);
    return request.post<IDept[]>('/dept/create');
  },
  //获取用户
  getUserList() {
    return request.get<IUser[]>('/users/list');
  },
  //获取所有用户
  getAllUserList() {
    return request.get<IUser[]>('/users/all/list');
  },
};
